import json
import numpy as np

def get_json_1280x800x10():
    setup_json = json.loads(setup_json1280x800x10)
    intrinsics_rational_json = json.loads(intrinsics_rational_json1280x800x10)
    return setup_json, intrinsics_rational_json

def get_json_1280x800x9():
    setup_json = json.loads(setup_json1280x800x9)
    intrinsics_rational_json = json.loads(intrinsics_rational_json1280x800x9)
    return setup_json, intrinsics_rational_json

def get_json_800x600x6():
    setup_json = json.loads(setup_json800x600x6)
    intrinsics_rational_json = json.loads(intrinsics_rational_json800x600x6)
    return setup_json, intrinsics_rational_json


def get_json_1280x800x4():
    setup_json  = json.loads(setup_json1280x800x4)
    intrinsics_rational_json = json.loads(intrinsics_rational_json1280x800x4)
    return setup_json, intrinsics_rational_json


def get_json_ana():
    return get_json_1280x800x9()

def get_json_bob():
    setup_json = json.loads(setup_json1280x800x9)
    intrinsics_rational_json = json.loads(intrinsics_rational_json1280x800x9_bob)
    return setup_json, intrinsics_rational_json

def get_json_carl():
    setup_json = json.loads(setup_json1280x800x9)
    intrinsics_rational_json = json.loads(intrinsics_rational_json1280x800x9_carl)
    return setup_json, intrinsics_rational_json

def get_json_david():
    setup_json = json.loads(setup_json640x480x3)
    intrinsics_rational_json = json.loads(intrinsics_rational_json640x480x3_david)
    return setup_json, intrinsics_rational_json

def get_json_eva():
    setup_json = json.loads(setup_json640x480x4)
    intrinsics_rational_json = json.loads(intrinsics_rational_json640x480x4_eva)
    return setup_json, intrinsics_rational_json

def get_json_frank():
    setup_json = setup_json_frank
    intrinsics_rational_json = intrinsics_rational_json_frank
    return setup_json, intrinsics_rational_json

def get_json_zyy():
    setup_json  = json.loads(setup_json1280x800x9)
    setup_json = {
        "views": [ 0, 1, 2, 3, 4, 5],
        "minimal_tree": [
            [1, 0],
            [2, 1],
            [1, 3],
            [1, 4],
            [5, 4]
        ]
    }
    intrinsics_rational_json = intrinsics_rational_json2448x2048x9_zyy
    return setup_json, intrinsics_rational_json


def get_ballglobal_cm():
    fitball_xyz_global =  np.array([[0, 0, 0],
                                [0, 22, 0],
                                [22, 22, 0],
                                [22, 0, 0],
                                [0, 0, 15]], dtype=np.float32)
    return fitball_xyz_global

def get_ballglobal_mm():
    fitball_xyz_global =  np.array([[0, 0, 0],
                                [0, 220, 0],
                                [220, 220, 0],
                                [220, 0, 0],
                                [0, 0, 200]], dtype=np.float32)
    return fitball_xyz_global

setup_json1280x800x10 = """
{
  "views": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
  "minimal_tree": [
    [9, 0],
    [9, 1],
    [9, 2],
    [9, 3],
    [9, 4],
    [9, 5],
    [9, 6],
    [9, 7],
    [9, 8]
  ]
}
"""

setup_json1280x800x9 = """
{
  "views": [ 0, 1, 2, 3, 4, 5, 6, 7, 8],
  "minimal_tree": [
    [1, 0],
    [8, 1],
    [1, 2],
    [1, 3],
    [1, 4],
    [1, 5],
    [1, 6],
    [1, 7]
  ]
}
"""

setup_json800x600x6 = """
{
  "views": [ 0, 1, 2, 3, 4, 5],
  "minimal_tree": [
    [1, 0],
    [2, 1],
    [3, 2],
    [4, 3],
    [5, 4],
    [0, 5]
  ]
}
"""

setup_json1280x800x4 = """
{
  "views": [ 0, 1, 2, 3],
  "minimal_tree": [
    [1, 0],
    [2, 1],
    [3, 2]
  ]
}
"""

setup_json640x480x3 = """
{
  "views": [ 0, 1, 2],
  "minimal_tree": [
    [1, 0],
    [2, 1]
  ]
}
"""

setup_json640x480x4 = """
{
  "views": [ 0, 1, 2, 3],
  "minimal_tree": [
    [1, 0],
    [2, 1],
    [1, 3]
  ]
}
"""

setup_json_frank = {
  "views": [ 0, 1, 2, 3, 4, 5],
  "minimal_tree": [
    [1, 0],
    [2, 1],
    [3, 2],
    [4, 3],
    [5, 4],
    [0, 5]
  ]
}


intrinsics_rational_json640x480x3_david = """
{
    "0": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[430, 0, 326],
            [0, 575, 231],
            [0, 0, 1]],
        "dist": [-0.369, 0.135, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "1": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[469, 0, 312],
            [0, 625, 235],
            [0, 0, 1]],
        "dist": [-0.399, 0.164, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "2": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[626, 0, 316],
            [0, 835, 246],
            [0, 0, 1]],
        "dist": [-0.37, 0.133, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "3": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[467, 0, 335],
            [0, 624, 246],
            [0, 0, 1]],
        "dist": [-0.429, 0.179, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    }
}
"""


intrinsics_rational_json640x480x3_david = """
{
    "0": {
        "date": "2024-01-09 20:16:09",
        "description": "by opencv",
        "K": [[588, 0, 329],
            [0, 783, 231],
            [0, 0, 1]],
        "dist": [-0.385, 0.177, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "1": {
        "date": "2024-01-09 20:16:09",
        "description": "by opencv",
        "K": [[521, 0, 329],
            [0, 695, 246],
            [0, 0, 1]],
        "dist": [-0.397, 0.187, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "2": {
        "date": "2024-01-09 20:16:09",
        "description": "by opencv",
        "K": [[490, 0, 319],
            [0, 653, 239],
            [0, 0, 1]],
        "dist": [-0.398, 0.164, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "3": {
        "date": "2024-01-09 20:16:09",
        "description": "by opencv",
        "K": [[565, 0, 336],
            [0, 749, 256],
            [0, 0, 1]],
        "dist": [-0.406, 0.184, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    }
}
"""

intrinsics_rational_json640x480x3_david = """
{
    "0": {
        "date": "2023-11-24 15:43:13",
        "description": "by opencv",
        "K": [[361, 0, 304],
            [0, 481, 253],
            [0, 0, 1]],
        "dist": [-0.342, 0.129, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "1": {
        "date": "2023-11-24 15:43:13",
        "description": "by opencv",
        "K": [[526, 0, 342],
            [0, 702, 209],
            [0, 0, 1]],
        "dist": [-0.355, 0.136, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "2": {
        "date": "2023-11-24 15:43:13",
        "description": "by opencv",
        "K": [[312, 0, 303],
            [0, 416, 258],
            [0, 0, 1]],
        "dist": [-0.417, 0.184, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    }
}
"""

intrinsics_rational_json640x480x4_eva = """
{
    "0": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[430, 0, 326],
            [0, 575, 231],
            [0, 0, 1]],
        "dist": [-0.369, 0.135, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "1": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[469, 0, 312],
            [0, 625, 235],
            [0, 0, 1]],
        "dist": [-0.399, 0.164, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "2": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[626, 0, 316],
            [0, 835, 246],
            [0, 0, 1]],
        "dist": [-0.37, 0.133, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "3": {
        "date": "2024-01-16 18:58:03",
        "description": "by opencv",
        "K": [[467, 0, 335],
            [0, 624, 246],
            [0, 0, 1]],
        "dist": [-0.429, 0.179, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    }
}
"""

intrinsics_rational_json1280x800x10 = """
{
    "0": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1120, 0.0, 606],
            [0.0,1183,386],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1120, 0.0, 606],
            [0.0,1183,386],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "1": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1157, 0.0, 639.24],
            [0.0,1155.39, 414.51],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1157, 0.0, 639.24],
            [0.0,1155.39, 414.51],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0.00, 0.00, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "2": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1164.80, 0.0, 660.27],
            [0.0, 1154.15, 405.47],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1164.80, 0.0, 660.27],
            [0.0, 1154.15, 405.47],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0.00, 0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "3": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1390.24, 0.0, 662.89],
            [0.0,1391.94,372.84],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1390.24, 0.0, 662.89],
            [0.0,1391.94,372.84],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "4": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1154.45, 0.0, 653.99],
            [0.0,1149.59,410.80],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1154.45, 0.0, 653.99],
            [0.0,1149.59,410.80],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "5": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1338.87, 0.0, 646.03],
            [0.0,1347.73,412.16],
            [ 0.0, 0.0, 1.0]],
        "K": [[1338.87, 0.0, 646.03],
            [0.0,1347.73,412.16],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "6": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1368.82, 0.0, 632.80],
            [0.0,1355.44, 442.61],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1368.82, 0.0, 632.80],
            [0.0,1355.44, 442.61],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "7": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 640],
            [0.0,1150,400],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1150, 0.0, 640],
            [0.0,1150,400],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "8": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1123.77, 0.0, 646.29],
            [0.0,1118.91,432.92],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1123.77, 0.0, 646.29],
            [0.0,1118.91,432.92],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "9": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1126.68, 0.0, 620.0],
            [0.0,1125.55,415.07],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[1126.68, 0.0, 620.0],
            [0.0,1125.55,415.07],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    }
}
"""

intrinsics_rational_json1280x800x9 =  """
{
    "0": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1141, 0, 633],
            [0, 1141, 436],
            [0, 0, 1]],
        "K_new": [[1141, 0, 633],
            [0, 1141, 436],
            [0, 0, 1]],
        "dist": [0.03, -0.045, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "1": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1191, 0, 587],
            [0, 1197, 414],
            [0, 0, 1]],
        "K_new": [[1191, 0, 587],
            [0, 1197, 414],
            [0, 0, 1]],
        "dist": [-0.077, 0.177, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "2": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1182, 0, 592],
            [0, 1190, 415],
            [0, 0, 1]],
        "K_new": [[1182, 0, 592],
            [0, 1190, 415],
            [0, 0, 1]],
        "dist": [-0.055, 0.109, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "3": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1182, 0, 594],
            [0, 1182, 406],
            [0, 0, 1]],
        "K_new": [[1182, 0, 594],
            [0, 1182, 406],
            [0, 0, 1]],
        "dist": [-0.084, 0.144, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "4": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1166, 0, 610],
            [0, 1166, 417],
            [0, 0, 1]],
        "K_new": [[1166, 0, 610],
            [0, 1166, 417],
            [0, 0, 1]],
        "dist": [-0.054, 0.09, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "5": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1166, 0, 610],
            [0, 1166, 414],
            [0, 0, 1]],
        "K_new": [[1166, 0, 610],
            [0, 1166, 414],
            [0, 0, 1]],
        "dist": [-0.047, 0.072, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "6": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1180, 0, 612],
            [0, 1176, 407],
            [0, 0, 1]],
        "K_new": [[1180, 0, 612],
            [0, 1176, 407],
            [0, 0, 1]],
        "dist": [-0.079, 0.089, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "7": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1174, 0, 611],
            [0, 1171, 410],
            [0, 0, 1]],
        "K_new": [[1174, 0, 611],
            [0, 1171, 410],
            [0, 0, 1]],
        "dist": [-0.071, 0.085, 0, 0, 0],
        "image_shape": [800, 1280]
    },
    "8": {
        "date": "2023-05-08 12:06:23",
        "description": "by opencv",
        "K": [[1170, 0, 620],
            [0, 1168, 410],
            [0, 0, 1]],
        "K_new": [[1170, 0, 620],
            [0, 1168, 410],
            [0, 0, 1]],
        "dist": [-0.049, 0.048, 0, 0, 0],
        "image_shape": [800, 1280]
    }
}
"""


intrinsics_rational_json1280x800x9_bob =  """
{
    "0": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "1": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "2": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "3": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "4": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "5": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "6": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "7": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "8": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    }
}
"""


intrinsics_rational_json1280x800x9_carl =  """
{
    "1": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "3": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "5": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "6": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "K_new":  [[1136,0,640],
            [0,1136,400],
            [0,0,1.0]],
        "dist": [0.05, -0.095, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "0": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "K_new":  [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "dist": [-0.005, -0.008, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "2": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "K_new":  [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "dist": [-0.005, -0.008, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "4": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "K_new":  [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "dist": [-0.005, -0.008, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "7": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "K_new":  [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "dist": [-0.005, -0.008, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    },
    "8": {
        "date": "2023-5-4 21:55:50",
        "description": "",
        "K": [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "K_new":  [[875,0,640],
            [0,875,400],
            [0,0,1.0]],
        "dist": [-0.005, -0.008, 0.0, 0.0, 0.0],
        "image_shape": [800,1280]
    }
}
"""


intrinsics_rational_json1280x800x4 = """
{
    "0": {
        "date": "2022-9-20 21:55:50",
        "description": "",
        "K": [[873, 0.0, 597],
            [0.0, 870, 381],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[873, 0.0, 597],
            [0.0, 870, 381],
            [ 0.0, 0.0, 1.0]],
        "dist": [-0.3334, 0.1779, 0, 0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "1": {
        "date": "2022-9-20 21:55:50",
        "description": "",
        "K": [[758, 0.0, 641.24],
            [0.0,756, 434],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[758, 0.0, 641.24],
            [0.0,756, 434],
            [ 0.0, 0.0, 1.0]],
        "dist": [-0.3336,0.1178, 0, 0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "2": {
        "date": "2022-9-20 21:55:50",
        "description": "",
        "K": [[758, 0.0, 641.24],
            [0.0,756, 434],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[758, 0.0, 641.24],
            [0.0,756, 434],
            [ 0.0, 0.0, 1.0]],
        "dist": [-0.3336,0.1178, 0, 0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    },
    "3": {
        "date": "2022-9-20 21:55:50",
        "description": "",
        "K": [[873, 0.0, 597],
            [0.0, 870, 381],
            [ 0.0, 0.0, 1.0]],
        "K_new": [[873, 0.0, 597],
            [0.0, 870, 381],
            [ 0.0, 0.0, 1.0]],
        "dist": [-0.3334, 0.1779, 0, 0, 0.0],
        "reproj_error": 0.22981242234408908,
        "image_shape": [800, 1280]
    }
}
"""



intrinsics_rational_json800x600x6 = """
{
    "0": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    },
    "1": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    },
    "2": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    },
    "3": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    },
    "4": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    },
    "5": {
        "date": "2021-11-10 21:55:50",
        "description": "",
        "K": [[1150, 0.0, 400],
            [0.0,1150,300],
            [ 0.0, 0.0, 1.0]],
        "dist": [ 0,0, 0,0, 0,0, 0,0, 0.0,
                    0.0, 0.0, 0.0, 0.0, 0.0],
        "reproj_error": 0.1,
        "image_shape": [600, 800]
    }
}
"""

intrinsics_rational_json_frank = {
    "0": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[435, 0, 333],
            [0, 582, 236],
            [0, 0, 1]],
        "dist": [-0.375, 0.126, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "1": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[461, 0, 312],
            [0, 616, 235],
            [0, 0, 1]],
        "dist": [-0.395, 0.166, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "2": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[406, 0, 316],
            [0, 541, 224],
            [0, 0, 1]],
        "dist": [-0.385, 0.138, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "3": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[396, 0, 318],
            [0, 528, 239],
            [0, 0, 1]],
        "dist": [-0.378, 0.122, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "4": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[425, 0, 326],
            [0, 565, 238],
            [0, 0, 1]],
        "dist": [-0.406, 0.149, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    },
    "5": {
        "date": "2024-02-01 01:53:05",
        "description": "by opencv",
        "K": [[675, 0, 316],
            [0, 901, 236],
            [0, 0, 1]],
        "dist": [-0.247, 0.174, 0.0, 0.0, 0.0],
        "image_shape": [480, 640]
    }
}



intrinsics_rational_json2448x2048x9_zyy =  {
    "0": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K": [[1798,   0,1208],
            [   0,1799,1024],
            [   0,   0,   1.0]],
        "dist": [-0.17401543, 0.08814991, 0.        , 0.        ,-0.02067681],
        "image_shape": [2048,2448]
    },
    "1": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K":[[1798,   0,1229],
            [   0,1797,1064],
            [   0,   0,   1.0]],
        "dist": [-0.17890745, 0.09393214, 0.        , 0.        ,-0.02584429],
        "image_shape": [2048,2448]
    },
    "2": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K": [[1798,   0,1229],
            [   0,1798,1045],
            [   0,   0,   1.0]],
        "dist": [-0.18075864, 0.10421788, 0.        , 0.        ,-0.0303006 ],
        "image_shape": [2048,2448]
    },
    "3": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K": [[1793,   0,1202],
            [   0,1796,1073],
            [   0,   0,   1.0]],
        "dist": [-0.20126433, 0.21206292, 0.        , 0.        ,-0.22260432],
        "image_shape": [2048,2448]
    },
    "4": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K":[[1801,   0,1186],
            [   0,1799,1035],
            [   0,   0,   1.0]],
        "dist": [-0.18788032, 0.0955026 , 0.        , 0.        ,-0.02587993],
        "image_shape": [2048,2448]
    },
    "5": {
        "date": "2023-8-14 21:55:50",
        "description": "",
        "K": [[1797,   0,1216],
                [   0,1797,1046],
                [   0,   0,   1.0]],
        "dist": [-0.18527107, 0.11815347, 0.        , 0.        ,-0.06058664],
        "image_shape": [2048,2448]
    }
}
